package PackageGeometry;

public class Test {
    public static void main(String[] args) {
        Cylinder[] cylinderArr = new Cylinder[3];
        cylinderArr[0] = new Cylinder(new Circle(5), 10);
        cylinderArr[1] = new Cylinder(new Circle(2), 14);
        cylinderArr[2] = new Cylinder(new Eclipse(6, 3), 8);
        for (int i = 0; i < cylinderArr.length; i++) {
            for (int j = 0; j < cylinderArr.length - 1 - i; j++) {
                Cylinder temp = new Cylinder(new Circle(0), 0);
                if (cylinderArr[i].calculateArea() < cylinderArr[i + 1].calculateArea()) {
                    temp = cylinderArr[i + 1];
                    cylinderArr[i + 1] = cylinderArr[i];
                    cylinderArr[i] = temp;
                }
            }
        }
        for (Cylinder cylinder : cylinderArr) {
            System.out.println(cylinder.calculateArea());
        }

        Geometry[] geometrieArr = new Geometry[3];
        geometrieArr[0] = new Circle();
        geometrieArr[1] = new Circle();
        geometrieArr[2] = new Eclipse();
        geometrieArr[0].draw();
        geometrieArr[1].draw();
        geometrieArr[2].draw();
    }

}
